package Chess.Pieces;

import java.awt.Color;
import Chess.*;

/**
 *	A class representing a King in Chess.
 *
 *	@author		Jeff Chan, James Kuo
 */
public class King extends Piece {

	public King(Color color) {
		super(color);
	}
	
	public boolean canAttack(Board board, Square currentSquare, Square occupiedSquare) {
		return (validSetupForAttack(board, currentSquare, occupiedSquare) &&
				currentSquare.isAdjacent(occupiedSquare));
	}

	public boolean canMove(Board board, Square currentSquare, Square emptySquare) {
		return (validSetupForMove(board, currentSquare, emptySquare) &&
				currentSquare.isAdjacent(emptySquare));
	}

	public PieceType getPieceType() {
		return PieceType.KING;
	}

}